<script setup>
import { ref } from "vue";
if (!uni.getStorageSync("token")) {
  uni.navigateTo({ url: "/pages/login/index" });
}
const goOrder = () => {
  if (!uni.getStorageSync("token")) {
    return uni.navigateTo({ url: "/pages/login/index" });
  }
  uni.navigateTo({ url: "/pages/index/order" });
};
const goPayCardInfo = () => {
  if (!uni.getStorageSync("token")) {
    return uni.navigateTo({ url: "/pages/login/index" });
  }
  uni.navigateTo({ url: "/pages/index/payCardInfo" });
};
</script>

<template>
  <view class="page">
    <view class="header">
      <view class="nav">
        <image class="logo" src="../../static/home_icon_dlslogo.png" mode="" />
        <text>代理商版</text>
      </view>
    </view>
    <view class="content">
      <image class="banner" src="../../static/home_banner.png" mode="" />
      <view class="feature">
        <view class="card" @click="goOrder()">
          <image class="icon" src="../../static/home_icon_gka.png" mode="" />
          <text>购卡</text>
        </view>
        <view class="message" @click="goPayCardInfo">
          <image class="icon" src="../../static/home_icon_gkxxin.png" mode="" />
          <text>购卡信息</text>
        </view>
      </view>
    </view>
  </view>
</template>

<style lang="scss" scoped>
.page {
  position: absolute;
  width: 100%;
  height: 100%;
  .header {
    width: 100%;
    height: 176rpx;
    background-color: #fff;
    overflow: hidden;
    .nav {
      display: flex;
      align-items: center;
      margin-top: 108rpx;
      margin-left: 32rpx;
      color: rgb(64, 158, 255);
      font-size: 32rpx;
      font-weight: 700;
      .logo {
        width: 48rpx;
        height: 48rpx;
        margin-right: 8rpx;
      }
    }
  }
  .content {
    padding: 30rpx;
    .banner {
      width: 690rpx;
      height: 280rpx;
      border-radius: 16rpx;
      margin-bottom: 30rpx;
    }
  }
  .feature {
    display: flex;
    justify-content: space-between;
    .card {
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      align-items: center;
      width: 330rpx;
      height: 226rpx;
      padding: 30rpx;
      font-size: 36rpx;
      font-weight: 700;
      color: rgb(48, 49, 51);
      background-color: #fff;
      border-radius: 16rpx;
    }
    .message {
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      align-items: center;
      width: 330rpx;
      height: 226rpx;
      padding: 30rpx;
      font-size: 36rpx;
      font-weight: 700;
      color: rgb(48, 49, 51);
      border-radius: 16rpx;
      background-color: #fff;
    }
    .icon {
      width: 100rpx;
      height: 100rpx;
    }
  }
}
</style>
